<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* rem是根据html根元素的font-size 改变 */
    /* em 是根据父元素的font-size改变 */
    #box{
      width: 500px;
      height: 500px;
      background: darkblue;
      font-size: 50px;
    }
    p{
      /* 父元素的font-size设置为50px 1em=50px */
      width: 2em;
      height: 2em;
      background: darkgoldenrod;
    }
    /*  calc()  对样式的属性值进行计算  */
    #move{
      /* 运算符和数值之间保留空格 */
        /* width: calc(100% - 100px); */
        width:calc( 100% - calc(100px * 2) );
        height: 300px;
        background: darkgreen;
    }
  </style>
</head>
<body>
  
  <div id="box">
    <p></p>
  </div>
  <div id="move"></div>
</body>
</html>